/* ============================================
   CSS CUSTOM PROPERTIES (Variables) - THEME SYSTEM
   ============================================ */
:root {
  /* Colors */
  --primary-color: #0078ff;
  --secondary-color: #00e1ff;
  --accent-color: #0062d3;
  --text-light: #ffffff;
  --text-dark: #333333;
  --bg-dark: #1e1e1e;
  --bg-darker: #121212;
  --bg-card: #2d2d2d;
  --overlay-blue: rgba(0, 217, 255, 0.25);
  --overlay-dark: rgba(0, 0, 0, 0.7);
  
  /* Spacing */
  --section-padding: 80px;
  --card-padding: 30px;
  --container-max-width: 1200px;
  
  /* Animations */
  --transition-fast: 0.3s ease;
  --transition-medium: 0.5s ease;
  --transition-slow: 0.8s ease;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(0, 120, 255, 0.3);
}

/* Light Mode Variables */
[data-theme="light"] {
  --bg-dark: #f8f9fa;
  --bg-darker: #e9ecef;
  --bg-card: #ffffff;
  --text-light: #212529;
  --text-dark: #495057;
  --overlay-blue: rgba(0, 120, 255, 0.15);
  --shadow-glow: 0 0 20px rgba(0, 120, 255, 0.15);
}

/* ============================================
   SMOOTH SCROLL & BASE STYLES
   ============================================ */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-darker);
  color: var(--text-light);
  transition: background-color var(--transition-medium), color var(--transition-medium);
}

/* ============================================
   DARK MODE TOGGLE BUTTON
   ============================================ */
.theme-toggle {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1000;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(0, 120, 255, 0.5);
}

.theme-toggle i {
  color: white;
  font-size: 1.2rem;
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--secondary-color);
  white-space: nowrap;
  animation: typing 3s steps(20, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--secondary-color); }
}

/* ============================================
   SKILL BARS ANIMATION
   ============================================ */
.skill-bar {
  width: 0;
  transition: width 1.5s ease-out;
}

.skill-bar.animate {
  width: var(--skill-width);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary-color);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   HOVER EFFECTS & INTERACTIONS
   ============================================ */
.a1, .card5, .blogCard {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.a1:hover, .card5:hover, .blogCard:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

/* Glassmorphism effect for cards */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   EXISTING STYLES (with variable integration)
   ============================================ */
header {
  background-image: url(../images/hero-bg.jpg);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}
.text1 {
  font-size: 5rem;
}

.percentage1 {
  width: 400px;
  height: 10px;
  background-color: black;
  grid-area: 2/1;
}
.percentage11 {
  width: 0;
  height: 10px;
  background-color: var(--primary-color);
  grid-area: 2/1;
  transition: width 1.5s ease-out;
}

.percentage11.animate {
  width: 85%;
}
.percentage2 {
  width: 400px;
  height: 10px;
  background-color: black;
  grid-area: 4/1;
}
.percentage22 {
  width: 0;
  height: 10px;
  background-color: var(--primary-color);
  grid-area: 4/1;
  transition: width 1.5s ease-out;
}

.percentage22.animate {
  width: 75%;
}
.percentage3 {
  width: 400px;
  height: 10px;
  background-color: black;
  grid-area: 6/1;
}
.percentage33 {
  width: 0;
  height: 10px;
  background-color: var(--primary-color);
  grid-area: 6/1;
  transition: width 1.5s ease-out;
}

.percentage33.animate {
  width: 50%;
}
.percentage4 {
  width: 400px;
  height: 10px;
  background-color: black;
  grid-area: 8/1;
}
.percentage44 {
  width: 0;
  height: 10px;
  background-color: var(--primary-color);
  grid-area: 8/1;
  transition: width 1.5s ease-out;
}

.percentage44.animate {
  width: 90%;
}

hr {
  height: 30px;
  color: blue;
}

.web {
  width: 60px;
  height: 60px;
  border: solid rgb(0, 225, 255);
  border-width: 1 1px;
  position: absolute;
  left: 75%;
}
.a1 {
  width: 25%;
}
/* .icons2{
    width: 30px;
    height: 30px;
    position: absolute;
    left: 50px;
} */
.bg1 {
  background-color: rgba(0, 0, 255, 0.267);
  height: 100%;
  width: 100%;
  position: absolute;
}
.seg4 {
  background-image: url(../images/counters-bg.jpg);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}

.icons2 {
  width: 100%;
}
.text4a {
  width: 100%;
}
.text4b {
  width: 100%;
}

.button5 {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  border: thin solid blue;
  background-color: wheat;
  position: absolute;
  bottom: 0px;
  right: 0px;
}

.card5 {
  width: 30%;
}

.slider {
  background-image: url(../images/overlay-bg.jpg);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  height: 100vh;
}

.overlay {
  background-color: rgba(0, 217, 255, 0.25);
  height: 100%;
  width: 100%;
  position: absolute;
}
#testimonial .carousel-indicators [data-bs-target] {
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
}
.blogText h4 {
  background-color: blue;
  position: absolute;
  left: 10rem;
  bottom: 0rem;
}
.blogText {
  width: 3rem;
}
.blogCard {
  width: 29%;
}

.section7 {
  background-image: url(../images/overlay-bg.jpg);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  height: 100vh;
}

.layer7 {
  background-color: rgba(0, 217, 255, 0.25);
  height: 100%;
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
}

.card5 img {
  transition: transform 0.2s;
  overflow: hidden;
}
.card5 img:hover {
  transform: scale(1.5);
  overflow: hidden;
}

.card5 {
  overflow: hidden;
}

.icons i:hover {
  background-color: cyan;
}

.web:hover {
  border-color: rgb(3, 3, 3);
}
@media screen and (max-width: 600px) {
  .web {
    position: absolute;
    left: 0%;
  }
}

@media screen and (max-width: 800px) {
  .web {
    position: absolute;
    left: 0%;
  }
}

@media screen and (max-width: 1000px) {
  .web {
    position: absolute;
    left: 0%;
  }
}

@media screen and (max-width: 800px) {
  img {
    width: 100%; /* The width is 100%, when the viewport is 800px or smaller */
  }
}
@media screen and (max-width: 800px) {
  p,
  h1,
  h2,
  h3,
  h4,
  h5 {
    font-size: 3vw; /* The width is 100%, when the viewport is 800px or smaller */
  }
}

@media screen and (max-width: 800px) {
  div {
    width: 100%; /* The width is 100%, when the viewport is 800px or smaller */
  }
}
@media screen and (max-width: 800px) {
  div {
    text-align: center; /* The width is 100%, when the viewport is 800px or smaller */
  }
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Small devices (phones, less than 768px) */
@media screen and (max-width: 767px) {
  /* Header & Hero */
  header {
    height: auto !important;
    min-height: 100vh;
    padding: 80px 20px;
  }
  
  .text1 {
    font-size: 2.5rem;
    text-align: center;
  }
  
  /* About section */
  #about {
    padding: 30px 15px !important;
  }
  
  #about .row {
    margin-bottom: 20px;
  }
  
  #about img {
    max-width: 200px;
    margin-bottom: 20px;
  }
  
  #about dl.row {
    text-align: center;
  }
  
  #about dt.col-sm-6,
  #about dd.col-sm-6 {
    width: 100%;
    text-align: center !important;
  }
  
  /* Progress bars - make them responsive */
  .percentage1,
  .percentage2,
  .percentage3,
  .percentage4 {
    width: 100% !important;
    max-width: 100%;
  }
  
  .percentage11 { width: 85% !important; }
  .percentage22 { width: 75% !important; }
  .percentage33 { width: 50% !important; }
  .percentage44 { width: 90% !important; }
  
  /* Services section */
  .section3 {
    padding: 40px 15px;
  }
  
  .icons {
    flex-direction: column !important;
  }
  
  .a1 {
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 20px;
  }
  
  .web {
    position: relative !important;
    left: auto !important;
    margin: 0 auto 15px auto;
  }
  
  /* Stats section */
  .seg4 {
    height: auto !important;
    padding: 40px 15px;
  }
  
  .icons2 {
    flex-direction: column !important;
    align-items: center !important;
    gap: 30px;
  }
  
  .icons2 > div {
    text-align: center;
  }
  
  /* Portfolio section */
  .section5 {
    flex-direction: column !important;
    padding: 0 15px;
  }
  
  .card5 {
    width: 100% !important;
    margin-bottom: 20px;
  }
  
  /* Testimonial */
  #testimonial {
    height: auto !important;
    min-height: 400px;
    padding: 40px 15px;
  }
  
  .carousel-caption {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    padding: 20px;
  }
  
  .carousel-caption h5,
  .carousel-caption p {
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
  }
  
  .w-10 {
    width: 80px !important;
    height: 80px;
  }
  
  /* Blog section */
  #blog {
    padding: 40px 15px;
  }
  
  #blog > .d-flex {
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .blogCard {
    width: 100% !important;
    max-width: 400px;
    margin: 10px 0 !important;
  }
  
  /* Contact form section */
  .section7 {
    height: auto !important;
    min-height: 100vh;
    padding: 40px 15px !important;
  }
  
  .layer7 {
    padding: 20px !important;
  }
  
  .section7 .col-6 {
    width: 100% !important;
    padding: 20px 0;
  }
  
  .section7 .row {
    flex-direction: column;
  }
  
  /* Fix form spacing */
  .form-group {
    margin-bottom: 15px;
  }
  
  /* Fix contact info layout */
  .section7 .d-flex {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 15px;
    margin-bottom: 10px;
  }
  
  .section7 .d-flex i {
    margin-top: 5px;
  }
  
  /* Typography adjustments */
  h2 {
    font-size: 1.8rem !important;
  }
  
  h3 {
    font-size: 1.3rem !important;
  }
  
  p {
    font-size: 1rem !important;
  }
}

/* Medium devices (tablets, 768px and up) */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .text1 {
    font-size: 3.5rem;
  }
  
  .a1 {
    width: 48% !important;
    margin: 5px !important;
  }
  
  .card5 {
    width: 48% !important;
  }
  
  .blogCard {
    width: 48% !important;
    margin: 5px !important;
  }
  
  .icons2 {
    flex-wrap: wrap;
    gap: 30px;
  }
  
  .icons2 > div {
    width: 45%;
    text-align: center;
  }
}

/* Remove old conflicting media queries */
@media screen and (max-width: 600px) {
  .web {
    position: relative !important;
    left: auto !important;
    margin: 0 auto 15px auto;
  }
}

@media screen and (max-width: 800px) {
  .web {
    position: relative !important;
    left: auto !important;
    margin: 0 auto 15px auto;
  }
  
  img {
    max-width: 100%;
    height: auto;
  }
}
